﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace weba
{
    public partial class zhuce : System.Web.UI.Page
    {
        sjklqDataContext sj = new sjklqDataContext();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            if (sj.T_ServiceUser.Where(h => h.T_ServiceName == this.yhm.Text.Trim().ToString()).Count() < 1)
            {
                T_ServiceUser s = new T_ServiceUser() { T_ServiceName = this.yhm.Text.Trim().ToString(), T_ServicePass = this.mm.Text.Trim().ToString(), T_ServiceTel = this.dh.Text.Trim().ToString(), T_ServiceMail = this.yx.Text.Trim().ToString(), T_ServiceQQ = this.qq.Text.Trim().ToString() };
                sj.T_ServiceUser.InsertOnSubmit(s);
                sj.SubmitChanges();
                Session["User_ID"] = this.yhm.Text.Trim().ToString();

                dl.CreatCookies("User_Name", 4, this.yhm.Text.Trim().ToString(), "");
                // dl.CreatCookies("", 4, lg.FirstOrDefault()..ToString(), "");
                Response.Redirect("Default.aspx", false);
            }
        }
    }
}